package com.oracle.violet.first.until

import com.oracle.violet.first.config.ConfigHandler
import redis.clients.jedis.JedisPool

/** 创建redis连接池
  * author: old sheep
  * QQ: 64341393 
  * Created 2018/10/10
  */
object Jpools {

    // 初始化连接池
    private lazy val jedisPool = new JedisPool(ConfigHandler.redisHost, ConfigHandler.redisPort)

    // 对外提供从连接池中获取连接的方法
    def getJedis = {
        jedisPool.getResource
    }


}
